	// 打印,新单语音播放控制
	import {util} from '@/static/js/common.js';
	
	
	
	
	
	
	
	
	
	var print_innerAudioContext     = null;
	var order_innerAudioContext     = null;

	

	/**
	 * 打印语音播放
	*/
	const print_Play=()=>{
		if(print_innerAudioContext != null){
			print_innerAudioContext.play()
		}
		
	}
	/**
	 * 打印语音组件销毁
	*/
	const print_destroy=()=>{
		if(order_innerAudioContext != null){
			print_innerAudioContext.destroy()
		}
		
	}
	/**
	 * 打印语音组件创建
	*/
	const print_createInnerAudioContext=()=>{
		print_innerAudioContext = uni.createInnerAudioContext()
		print_innerAudioContext.src = util.baseUrl.host+util.baseUrl.static+'voice/new_print.mp3';
		// console.log('print_createInnerAudioContext 创建');
		/* print_innerAudioContext.onPlay(() => {
		  console.log('print_innerAudioContext 开始播放');
		});*/
	
		print_innerAudioContext.onError((res) => {
		  console.log('print_innerAudioContext',res.errMsg ? res.errMsg : '');
		  console.log('print_innerAudioContext',res.errCode ? res.errCode:'');
		}); 
	
	}
	
	/**
	 * 新单语音播放
	*/
	const order_Play=()=>{
		if(order_innerAudioContext != null){
			order_innerAudioContext.play()
		}
		
	}
	/**
	 * 新单语音组件销毁
	*/
	const order_destroy=()=>{
		if(order_innerAudioContext != null){
			order_innerAudioContext.destroy()
		}
	}
	/**
	 * 新单语音组件创建
	*/
	const order_createInnerAudioContext=()=>{
		order_innerAudioContext = uni.createInnerAudioContext()
		order_innerAudioContext.src = util.baseUrl.host+util.baseUrl.static+'voice/new_order.mp3';
		// console.log('order_createInnerAudioContext 创建',order_innerAudioContext.src);
		/* order_innerAudioContext.onPlay(() => {
		  console.log('order_innerAudioContext 开始播放');
		});
	
		order_innerAudioContext.onError((res) => {
		  console.log('order_innerAudioContext',res.errMsg);
		  console.log('order_innerAudioContext',res.errCode);
		}); */
	
	}
	print_createInnerAudioContext()
	order_createInnerAudioContext()
	//注册定义的方法
	export const voice= {
		print_createInnerAudioContext,
		print_Play,
		print_destroy,
		
		order_createInnerAudioContext,
		order_Play,
		order_destroy
		
	}
